package com.project.util;

import com.alibaba.fastjson.JSON;
import lombok.Data;

import java.io.File;

@Data
public class Config {

    // 数据库
    private String driver;
    private String url;
    private String username;
    private String password;

    // 输出路径
    private String outPath;

    // 项目名称
    private String projectName;

    /* 项目结构 */
    // java 目录信息
    private String javaPath;
    private String javaBasicPath;
    private String controllerPath;
    private String modelPath;
    private String mapperPath;
    private String mapperXmlPath;
    private String servicePath;
    private String serviceImplPath;

    // resource 目录信息
    private String resourcesPath;

    // webApp 目录信息
    private String webAppPath;

    private Config() { }

    public static Config getConfig(File configFile){
        String sc = IoUtil.readFile(configFile);
        Config config = JSON.parseObject(sc, Config.class);
        return config;
    }

}
















